﻿
namespace FlexPlatform.Common
{
    using System;

    using FlexPlatform.GeneralUse;
    using FlexPlatform.Common.Configuration;
    using FlexPlatform.Shared.Configuration;

    using Microsoft.Practices.Unity;
    using System.Data.Entity;
    using FlexPlatform.Common.DependencyResolvers;

    public static class SystemGlobal
    {
        /// <summary>
        /// Thread static member.
        /// </summary>
        [ThreadStatic]
        private static Workspace clsCurrentInstance;

        static SystemGlobal()
        {
            Configuration = new ConfigurationContainer();
            ServiceLocator = new ServiceLocator();
        }

        public static ConfigurationContainer Configuration { get; set; }
        public static ServiceLocator ServiceLocator { get; set; }
       
        public static IWorkspace CurrentWorkspace
        {
            get
            {
                return clsCurrentInstance;
            }
        }
    
        internal static void SetCurrentWorkspace(Workspace workspace)
        {
            clsCurrentInstance = workspace;
        }
    }
}
